var scrollFalse=0;

function showHiddenTopInstall(dis,str){
    if(dis == "none")
    {
        $('#destory').attr("style","display:none");
    }
    else
    {
        $('#destory').attr("style","display:block");
    }
    
    if(str == "g"){
        $('#header01').attr("style","display:none");
        $('#header02').attr("style","display:block");
       
    }else{
        $('#header01').attr("style","display:block");
        $('#header02').attr("style","display:none");
    }
}

function agentListView(page){

    tableMaker(agentListMap,page,"t1","1");
        //contentsScroll('contentsScroll4');
        //scrollFalse=1;
    
    console.log("index.ui.js >>total count !! " + agentListMap.size());
   
    for(i=1;i<agentListMap.size()+1;i++)
    {
        $("#tdN"+i).text(strcutting(agentListMap.get(i-1),14));
        $("#imgN"+i).attr("src","http://healthavatar.snubi.org:8080/Developer/img/"+agentListIdxMap.get(i-1)+".png");
        console.log("index.ui.js >>http://healthavatar.snubi.org:8080/Developer/img/"+agentListIdxMap.get(i-1)+".png");
        	
    }
    
  
    var contscroll = new iScroll('contentsScroll4',{hScroll:false});
}

function contractListView(page){
    
    if(contractListMap.size() > 0){
    
        tableMaker(contractListMap,page,"t2","1");
    
       // contentsScroll('contentsScroll4');
       // scrollFalse=1;
        for(i=1;i<contractListMap.size()+1;i++)
        {
            $("#tdN"+i).text(strcutting(contractListMap.get(i-1),14));
            $("#imgN"+i).attr("src","http://healthavatar.snubi.org:8080/Developer/img/"+contractListIdxMap.get(i-1)+".png");
        }
    
        var contscroll = new iScroll('contentsScroll4',{hScroll:false});
    }else{
    
        $('#'+page).html("");
    }
}


function recommendListView(page){
    
    if(recommendListMap.size() > 0){
    
    tableMaker(recommendListMap,page,"t3","1");
        contentsScroll('contentsScroll4');
        scrollFalse=1;
    for(i=1;i<recommendListMap.size()+1;i++)
    {
        $("#tdN"+i).text(strcutting(recommendListMap.get(i-1),14));
        $("#imgN"+i).attr("src","http://healthavatar.snubi.org:8080/Developer/img/"+recommendListIdxMap.get(i-1)+".png");
    }
        
    }else{
        
        $('#'+page).html("");
    }
    
}


function testUI()
{
	var cont = "";
	
		        cont += "<li data-theme='b'><a href=javascript:iframesrc(84);contentsPaging('contents5');showHiddenTopInstall('block','');>"+
		        "<img src='http://healthavatar.snubi.org:8080/Developer/img/84.png' class='ui-li-icon ui-corner-none'>다이어트게임-With U<span class='ui-li-count' id='noti84'  style=''>0</span></a></li>";
		    
		    $("#listview001").html(cont);
		    $("#listview001").listview("refresh");
		    console.log("index.ui.js >>contractUi");
	}

function contractUi(){
    
    //console.log("index.ui.js >>contractUi");
   
     
    
    var cont = "<li data-theme='a'><a href=javascript:contentsPaging('contents4');contractListView('contentsScroll4');>CONTRACTED AGENTS</a></li>";
    
    for(y=0; y < contractListMap.size(); y++){
        
        // console.log("index.ui.js >>contractUi"+ contractListIdxMap.get(y));
        
        
        cont += "<li data-theme='b'><a href=javascript:iframesrc("+contractListIdxMap.get(y)+");contentsPaging('contents5');showHiddenTopInstall('block','');>"+
        "<img src='http://healthavatar.snubi.org:8080/Developer/img/"+contractListIdxMap.get(y)+".png' class='ui-li-icon ui-corner-none'>" + strcutting(contractListMap.get(y),10) + "<span class='ui-li-count' id='noti"+contractListIdxMap.get(y)+"'  style=''>0</span></a></li>";
    }
     
    //$("#listview001").html(cont);
    //$("#listview001").listview("refresh");
    //console.log("index.ui.js >>contractUi");
}

function recommendUi(){
    
    //console.log("index.ui.js >>recommendUi");
    
    var cont = "<li data-theme='a'><a href=javascript:contentsPaging('contents4');recommendListView('contentsScroll4');showHiddenTopInstall('none','');>RECOMMEND AGENTS</a></li>";
    
    for(y=0; y < recommendListMap.size(); y++){
        cont += "<li data-theme='b'><a href=javascript:agentDoItRecomm("+recommendListIdxMap.get(y)+",'"+sessionStorage.getItem('id')+"','1')><img src='http://healthavatar.snubi.org:8080/Developer/img/"+recommendListIdxMap.get(y)+".png' class='ui-li-icon ui-corner-none'>" + strcutting(recommendListMap.get(y),10) + "</a></li>";
    }
    
    
    $("#listview002").html(cont);
    $("#listview002").listview("refresh");
    //console.log("index.ui.js >>recommendUi");
}









